﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace Util
{
   public class ConfigHelper
    {
        public static string GetSection( string SectionName, string fileName = "appsettings.json")
        {
            IConfiguration _configuration;
            var builder = new ConfigurationBuilder();
            _configuration = builder.Add(new JsonConfigurationSource { Path = fileName, Optional = false, ReloadOnChange = true }).Build();
            return _configuration.GetSection(SectionName).Value;
        }

    }
}
